package com.innovation.chengzhangriji.ui;

import android.app.Activity;

import com.innovation.chengzhangriji.preferences.LoginInfo;

public abstract class BaseLoginFragment extends BaseFragment {

    public interface LoginSuccessListener {

        void loginSuccess(LoginInfo response);
    }

    protected LoginSuccessListener mLoginSuccessListener;

    public void setLoginSuccessListener(LoginSuccessListener loginSuccessListener) {
        mLoginSuccessListener = loginSuccessListener;
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        try {
            mLoginSuccessListener = (LoginSuccessListener) activity;
        } catch (ClassCastException e) {
            throw new ClassCastException(activity.toString()
                    + " must implement LoginSuccessListener");
        }
    }
}
